home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Id: transp_test.java,v 1.10 1996/10/03 19:46:51 hudson Exp $
- * $Author: hudson $
- */
-
- package sub_arctic.test;
-
- import sub_arctic.lib.interactor_applet;
- import sub_arctic.lib.manager;
- import sub_arctic.lib.interactor;
- import sub_arctic.lib.interactor_consts;
- import sub_arctic.lib.top_level;
- import sub_arctic.lib.base_parent_interactor;
- import sub_arctic.lib.icon;
- import sub_arctic.lib.label;
- import sub_arctic.lib.transparency_container;
- import sub_arctic.lib.drag_container;
- import sub_arctic.output.transparent_drawable;
- import java.awt.Font;
-
- class t_test extends transparency_container {
- public t_test(int x, int y)
- {
- super(x,y,255);
- }
-
- public void configure()
- {
- int t;
-
- super.configure();
-
- // set transparency based on x position
- // (we are inside drag, so we go up one level to get real position)
- t = (600 - parent().x())*255/600;
- if (t < 3) t = 3;
- if (t > transparency_container.OPAQUE )
- t = transparency_container.OPAQUE;
- set_alpha_value(t);
- }
- }
-
- public class transp_test extends interactor_applet implements interactor_consts
- {
-
- public void build_ui(base_parent_interactor top)
- {
- interactor child, child1;
- drag_container drag;
- transparency_container trans;
-
- child = new label("<---- Drag To Change Transparency ---->",
- new Font("Helvetica",Font.BOLD,18));
- child.set_pos(50,50);
- top.add_child(child);
-
- drag = new drag_container(10,10, false);
- top.add_child(drag);
-
- // trans = new transparency_container(0,0);
- trans = new t_test(0,0);
- drag.add_child(trans);
-
- try {
- child = new icon(0,0,manager.load_doc_image(this,"images/gvu.gif"));
- trans.add_child(child);
-
- child = new coord_tracker(10,70,"Pos = [", "]");
- trans.add_child(child);
- } catch (java.net.MalformedURLException e) {
- showStatus("problem loading image for test");
- }
- }
- }
-
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-